<?php html::pushHead('goods/sort.css', TRUE);?>

<div class="box all-sort has-cl">
<?php $u=url::g('u=cgoods\sort\v&id='); if($res[0])foreach($res[0] as $v){?>
<h1><a href="<?php echo $u.$v['id']?>"><?php e_h($v['name'])?></a></h1>
<ul>
  <?php if($res[$v['id']])foreach($res[$v['id']] as $v2){?>
  <li><h2><a href="<?php echo $u.$v2['id']?>"><?php e_h($v2['name'])?></a></h2>
    <?php if($res[$v2['id']])___abc($res, $v2['id'], $u);?>
  </li>
 <?php }?>
</ul>
<?php }?>


<?php 
function ___abc($res, $id, $u){
  echo '<ul>';
  foreach($res[$id] as $v){
	 echo '<li><b><a href="'. $u.$v['id'] .'">'. htmlspecialchars($v['name']) .'</a></b>';
	 if($res[$v['id']])___abc($res, $v['id'], $u);
	 echo '</li>';
  }
  echo '</ul>';
}
?>
</div>